package lab02.test19;

public class Inverted {
    public static void main(String[] args) {
        String str ="HelloWorld";
        //将字符串转化为char数组
        char[] ch =str.toCharArray();
        StringBuffer buffer =new StringBuffer();
        for (int i=str.length() - 1;i >=0;i--){
            if (ch[i]>='A'&& ch[i]<='Z'){
                buffer.append(String.valueOf(ch[i]).toLowerCase());
            }else if (ch[i]>='a'&& ch[i]<='z'){
                buffer.append(String.valueOf(ch[i]).toUpperCase());
            }
        }
        System.out.println(buffer.toString());
    }
}
